{extend name="../../admin/view/main"}
{block name="content"}
<style>
.layui-table-cell {

    height: auto;

    line-height: 28px;
}
</style>
<div class="think-box-shadow">
    <fieldset>
        <legend>条件搜索</legend>
        <form action="{:sysuri()}" id="TagsDataSearch" autocomplete="off" class="layui-form layui-form-pane nowrap form-search" method="get" onsubmit="return false">
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">视频号名称</label>
                <label class="layui-input-inline">
                    <input class="layui-input" name="name" placeholder="请输入视频号名称" value="{$get.name|default=''}">
                </label>
            </div>

            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">创建时间</label>
                <label class="layui-input-inline">
                    <input class="layui-input" data-date-range name="created_at" placeholder="请选择创建时间" value="{$get.created_at|default=''}">
                </label>
            </div>

            <div class="layui-form-item layui-inline">
                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
                <!-- {if auth('add')} -->
                <button class="layui-btn" data-title="添加视频号" data-modal="{:url('add')}" type="button">
                    <i class="layui-icon">&#xe61f;</i> 添 加
                </button>
                <!-- {/if} -->
            </div>

        </form>
    </fieldset>
    <table id="TagsData" data-url="{:sysuri()}" data-target-search="#TagsDataSearch"></table>
</div>

<script>
    $(function () {
        $('#TagsData').layTable({
            even: true, height: 'full',
            sort: {field: 'id', type: 'desc'},
            cols: [[
                {field: 'id', title: 'ID', width: 80, align: 'center', sort: true},
                {field: 'name', title: '视频号名称', minWidth: 100},
                {field: 'appid', title: '视频号appid', minWidth: 100},
                {field: 'qrcode_path',toolbar: '#qrcode_path',  title: '专属分享码', minWidth: 100},
                {field: 'accountInfo',toolbar: '#accountInfo',  title: '佣金信息', minWidth: 250},
                {field: 'created_at', title: '创建时间', minWidth: 170, align: 'center'},
                {field: 'updated_at', title: '更新时间', minWidth: 170, align: 'center'},
                {toolbar: '#ToolbarTagsData', title: '操作面板', minWidth: 300, align: 'center', fixed: 'right'},
            ]]
        });
    });
</script>

<!-- 操控面板的模板 -->
<script type="text/html" id="ToolbarTagsData">
<!--{if auth("edit")}-->
    <a class="layui-btn layui-btn-xs" data-title="编辑" data-modal='{:url("edit")}?id={{d.id}}'>编 辑</a>
    <!--{/if}-->

    <!--{if auth("remove")}-->
    <a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除此公众号吗？" data-action="{:url('remove')}" data-value="id#{{d.id}}">删 除</a>
    <!--{/if}-->
    <a class="layui-btn layui-btn-xs" data-action="{:url('wechat/download')}" data-value="id#{{d.id}}">下 载</a>
    <br/>
    <!--{if auth("settlement")}-->
    <a class="layui-btn layui-btn-xs" data-title="标记打款" data-modal='{:url("channel.wechat/markPay")}?id={{d.id}}'>标记打款</a>
    <a class="layui-btn layui-btn-xs" data-title="明细" data-href='admin.html#{:url("channel.wechat/settlementNote")}?id={{d.id}}'>明细</a>
    <!--{/if}-->
</script>
<script type="text/html" id="qrcode_path">
    <div class="headimg headimg-no" data-tips-hover data-tips-image data-lazy-src="{{d.qrcode_path}}">
        <img src="{{d.qrcode_path}}" height="80">
    </div>
</script>
<script type="text/html" id="accountInfo">
    <div class="have">
       已结算：￥{{d.settlement_amount}}<br/>已打款：￥{{d.withdraw_amount}}<br/>未结算销售额：￥{{d.not_settlement_amount}}
    </div>
</script>
{/block}
